/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mii.dao.impl;

import entity.NotaService;
import java.util.List;
import javax.persistence.EntityManager;
import mii.dao.NotaServiceDAO;

/**
 *
 * @author Sven
 */
public class NotaServiceDAOImpl extends GenericDAOImpl implements NotaServiceDAO{

    
     public NotaServiceDAOImpl(EntityManager em){
        super(em);
    }
    @Override
    public NotaService getByNopol(String nopol) {
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        return(NotaService) this.em.createQuery("SELECT n FROM Notaservice n WHERE n.nopol LIKE : param").setParameter("param", "%"+nopol+"%");
    }

    @Override
    public NotaService getByNomor(String nomorNota) {
     //   throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        return(NotaService) this.em.createQuery("SELECT n FROM Notaservice n WHERE n.nomornota LIKE : param").setParameter("param","%"+nomorNota+"%");
    }

    @Override
    public List<NotaService> getAll() {
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        return this.em.createQuery("SELECT n FROM Notaservice n").getResultList();
    }
    
}
